﻿@model AutoPartsSearch.Web.Areas.Administration.Models.SellerAccount.PagedViewModel
@using AutoPartsSearch.Web.HtmlHelpers
@{
    ViewBag.Title = "List";
    Layout = "~/Areas/Administration/Views/_Layout.cshtml";
}
<h2>List</h2>
<fieldset>
    
    <table class="table-form list">
        <thead>
            <tr>
                <th></th>
                <th>Название компании/ФИО </th>
                <th>Лицо</th>
                <th>EMail</th>   
                <th>Создан</th>
                <th class="pad3">Активен до</th>
                <th>Котировки</th>
                <th>Заблокирован</th>
                <th style="width: 120px;">Последняя активность</th>
                <th>Онлайн</th>
                <th colspan="3">
                    <table>
                        <tr>
                            <td colspan="3">Предложения</td>
                        </tr>
                        <tr>
                            <td style="width: 50px; text-align: center;">Итого</td>
                            <td style="width: 50px; text-align: center;">Сегодня</td>
                            <td style="width: 150px; text-align: center;">Последнее</td>
                        </tr>
                    </table>
                </th>
            </tr>
        </thead>
        <tbody>
            @foreach (var seller in Model.Sellers)
            {
                <tr>
                    <td>
                        @Html.ActionLink("Детали", "Details", new { id = seller.Id }, new { @class = "editButton" })
                    </td>
                    <td>@seller.CompanyName</td>
                    <td>@(seller.IsIndividual ? "Физ" : "Юр")</td>
                    <td>@seller.EMail</td>
                    <td>@seller.Created.ToString("dd/MM/yyyy")</td>
                    <td class="@(seller.IsGoingToExpire ? "expired" : string.Empty ) pad3">@seller.Expired.ToString("dd/MM/yyyy")</td>
                    <td class="@(seller.IsQuoteEnabled ? "yes" : "no")"></td>
                    <td>@(seller.IsBlocked ? "Да" : "Нет")</td>
                    <td class="@seller.ActivityType">@seller.LastActivityDate.ToString("yyyy/MM/dd HH:mm")</td>
                    <td class="@(seller.IsOnline ? "online" : "offline")"></td>
                    <td style="width: 50px; text-align: center;">@seller.TotalOffersCount</td>
                    <td style="width: 50px; text-align: center;">@seller.DayOffersCount</td>
                    <td style="width: 150px; text-align: center;">@(seller.LastOfferDate.HasValue ? seller.LastOfferDate.Value.ToString("dd/MM/yyyy HH:mm") : string.Empty)</td>
                </tr>
            }
        </tbody>
        <tfoot>
            <tr>
                <td colspan="8" class="paging">@Html.PageLinks(Model.PagingInfo, page => Url.Action("List", new {page = page}))</td>
            </tr>
        </tfoot>
    </table>
    
</fieldset>